﻿using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

namespace LpbPrj.Client.Results.Dtos
{
    public class CornealTopoGraphyEditDto
    {
        public int? Id { get; set; }

        public string SeriesInstanceUid { get; set; }
        public string Description { get; set; }


        public long StudyId { get; set; }
        public int PatientId { get; set; }





        public long? CreatorUserId { get; set; }
        public DateTime CreationTime { get; set; }


        public CornealTopoGraphyEditDto()
        {
            CreationTime = DateTime.Now;
            SeriesInstanceUid = string.Empty;
            Description = string.Empty;
            StudyId = -1;
        }


        public CornealTopoGraphyEditDto Clone() //浅CLONE
        {
            return MemberwiseClone() as CornealTopoGraphyEditDto;
        }

        public CornealTopoGraphyEditDto Duplicate() //深clone
        {
            MemoryStream stream = new MemoryStream();
            BinaryFormatter formatter = new BinaryFormatter();
            formatter.Serialize(stream, this);
            stream.Position = 0;
            return formatter.Deserialize(stream) as CornealTopoGraphyEditDto;
        }

        public CornealTopoGraphyEditDto CopyInput() //深clone
        {
            MemoryStream stream = new MemoryStream();
            BinaryFormatter formatter = new BinaryFormatter();
            formatter.Serialize(stream, this);
            stream.Position = 0;
            return formatter.Deserialize(stream) as CornealTopoGraphyEditDto;
        }
    }
}
